import moment from 'moment';

export const columns = () => [
  {
    title: '代理商名称',
    dataIndex: 'keyword',
    hideInTable: true,
  },
  {
    title: '代理商信息',
    dataIndex: 'supplierId',
    width: 240,
    ellipsis: true,
    hideInSearch: true,
    render: (_, record) => (
      <div>
        <div>{record?.agentCompanyName}</div>
        <div>代理商ID:{record?.agentCompanyId}</div>
      </div>
    ),
  },
  {
    title: '本月总会员分润（￥）',
    width: 200,
    dataIndex: 'profit',
    ellipsis: true,
    hideInSearch: true,
  },
  {
    title: '被分润会员数(人)',
    dataIndex: 'numberofBeneficiaries',
    width: 200,
    ellipsis: true,
    hideInSearch: true,
  },
  {
    title: '人均分润(￥)',
    width: 200,
    dataIndex: 'perCapitaProfit',
    ellipsis: true,
    hideInSearch: true,
  },
  {
    title: '结算月份',
    width: 180,
    dataIndex: 'settlementMonth',
    ellipsis: true,
    hideInSearch: true,
    render: (_, record) =>
      record.settlementMonth && moment(record.settlementMonth).format('YYYY-MM-DD HH:mm:ss'),
  },
  {
    title: '创建时间',
    width: 180,
    dataIndex: 'createTime',
    valueType: 'dateRange',
    fieldProps: {},
    search: {
      transform: (value) => {
        return {
          startTime: value[0],
          endTime: value[1],
        };
      },
    },
    render: (_, record) =>
      record.createTime && moment(record.createTime).format('YYYY-MM-DD HH:mm:ss'),
  },
  // {
  //   title: '操作',
  //   width: 120,
  //   fixed: 'right',
  //   hideInSearch: true,
  //   // render: (record) => (
  //   //   <div>
  //   //     <a onClick={() => handleEdit('edit', record)}>编辑</a>
  //   //     <Divider type="vertical" />
  //   //     <a onClick={() => handleEdit('delete', record)}>删除</a>
  //   //   </div>
  //   // ),
  // },
];
